﻿
namespace LS.Nc6.Application.Cms
{
    /// <summary>
    /// 内容组
    /// </summary>
    public class CmsContentGroupService : BaseService<CmsContentGroupEntity>,ICmsContentGroupService,ITransient {

        public async Task<bool> ExistsName(long id, string groupName)
        {
            return await DbContext.Instance.Queryable<CmsContentGroupEntity>().WhereIF(id > 0, a => a.Id != id).WhereIF(!string.IsNullOrEmpty(groupName), a => a.GroupName == groupName)
                .CountAsync() > 0;
        }
    }
}
